<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html lang="zh-CN">
    <head>
        <meta charset="UTF-8">
        <title>个人信息 | 企业安全应急响应与缺陷管理中心 | <?php echo ($site_name_cn); ?>安全应急响应中心</title>
        <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
        <meta name="description" content="<?php echo ($site_name_cn); ?>安全应急响应中心,<?php echo ($site_name_en); ?> Security Response Center">
        <meta name="keywords" content="<?php echo ($site_name_cn); ?>,<?php echo ($site_name_en); ?>,安全团队,应急响应,<?php echo ($site_name_cn); ?>安全应急响应中心,<?php echo ($site_name_en); ?> Security Response Center">
        <meta name="renderer" content="webkit">
        <meta name="viewport" content="width=device-width, initial-scale=0.5, maximum-scale=0.5, minimum-scale=0.5, user-scalable=no">
        <link rel="icon" href="/Public/Index/images/logo.ico">
        <link rel="stylesheet" href="/Public/Index/css/main.css">
        <!--[if (gte IE 6)&(lte IE 8)]>
        兼容 CSS3 选择器
        <script type="text/javascript" src="/Public/Index/js/selectivizr.min.js"></script>
        兼容 media query
        <script type="text/javascript" src="/Public/Index/js/respond.min.js"></script>
        <![endif]-->
    </head>
    <body>
        <div class="header">
            <div>
                <div class="logo">
                    <a href="">
                        <div class="logo_pic">
                        </div>
                        <div class="logo_name">
							<p><?php echo ($site_name_cn); ?>安全应急响应中心</p>
                            <p><?php echo ($site_name_en); ?> Security Response Center</p>
                        </div>
                    </a>
                </div>

                <div class="userpanel">
                    <div class="userpanel_line">
                        <div></div>
                    </div>
                    <div class="userpanel_user">
                        <img class="user_avatar mod-avatar-30" src="/Public/Uploads/<?php echo session('avatar');?>" alt="">
                        <span class="user_username"><?php echo session('username'); if(session('mnum') == 0): else: ?><i class="i-header-message"><?php echo session('mnum');?></i><?php endif; ?></span>
                        <i class="user_arrow"></i>
                        <div class="user_menu">
                            <ul class="menu_list">
                                <li class="list_item list_item-user">
                                    <a href="<?php echo U('index/index');?>">
                                        <i class="item_icon"></i>
                                        <span class="item_text">个人主页</span>
                                    </a>
                                </li>
                                <li class="list_item list_item-message">
                                    <a href="<?php echo U('message/index');?>">
                                        <i class="item_icon"></i>
                                        <span class="item_text">消息中心</span>
                                        <i class="item_icon-message"><?php echo session('mnum');?></i>
                                    </a>
                                </li>
                                <li class="list_item list_item-account">
                                    <a href="<?php echo U('info/index');?>">
                                        <i class="item_icon"></i>
                                        <span class="item_text">账户设置</span>
                                    </a>
                                </li>
                                <li class="list_item list_item-logout">
                                    <a href="<?php echo U('login/logout');?>">
                                        <i class="item_icon"></i>
                                        <span class="item_text">注销</span>
                                    </a>
                                </li>
                            </ul>
                        </div>
                    </div>
                </div>

                <div class="nav">
                    <ul>
                        <li class="[index_banner]"><a href="/index.php">首页</a></li>
                        <li class="[banner_selected]"><a href="<?php echo U('post/add');?>">提交漏洞</a></li>
                        <li class="[annoucment_banner]"><a href="/index.php?m=&c=page&a=index">公告</a></li>
						<li class="[blog_banner]"><a href="/index.php?m=&c=blog&a=index">博客</a></li>
						<li class="[hall_banner]"><a href="/index.php?m=&c=hall&a=index">贡献榜</a></li>
                        <li class="[gift_banner]"><a href="<?php echo U('gift/index');?>">礼品兑换</a></li>
                    </ul>
                </div>
            </div>
        </div>
        <div class="container container-user container-user-account-detail">
            <div>
                <!-- section-subnav 标题-->
                <div class="section section-subnav">
                    <div class="section_subnav">
                        <p class="subnav_title"><a href="user-center.html">个人中心</a></p>
                    </div>
                </div>

                <div class="section section-user">
                    <div class="section_user">
                        <div class="user_sidebar">
                            <div class="sidebar_header">
                                <!-- <p>个人中心</p> -->
                            </div>
                            <ul class="sidebar_nav">
                                <li class="nav_item"><a href="<?php echo U('index/index');?>">我的个人中心</a></li>
                                <li class="nav_item"><a href="<?php echo U('gift/record');?>">我的安全币</a></li>
                                <li class="nav_item"><a href="<?php echo U('post/index');?>">我报告的漏洞</a></li>
                                <li class="nav_item"><a href="<?php echo U('gift/order');?>">我的礼品</a></li>
                                <li class="nav_item"><a href="<?php echo U('message/index');?>">消息中心</a></li>
                                <li class="nav_item nav_item-active"><a href="<?php echo U('info/index');?>">我的个人信息</a></li>
                            </ul>
                        </div>
						<?php if(is_array($info)): foreach($info as $key=>$v): ?><div class="user_body">
                            <a href="<?php echo U('info/update');?>" class="mod-btn mod-btn-black">修改基本信息</a>

                            <div class="body_block body_block-info">
                                <h3>基本信息</h3>
                                <div class="block_avatar">
                                    <span>头像</span><img style="height:100px;width:100px;border-radius: 50%;-moz-border-radius:50%;-webkit-border-radius:50%;" src="/Public/Uploads/<?php echo ($v["avatar"]); ?>" alt="">
                                </div>
                                <div class="block_content">
                                    <div class="content_leftblock">
                                        <p class="content_nickname">昵称：<span><?php echo ($v["username"]); ?></span></p>
										<p class="content_name">真实姓名：<span><?php echo ($v["realname"]); ?></span></p>
                                        <p class="content_team">团队：<span><?php echo ($v["team"]); ?></span></p>
                                        <p class="content_wechat">微信：<span><?php echo ($v["wechat"]); ?></span></p>
                                        <p class="content_signature">个人简介：<span><?php echo ($v["description"]); ?></span></p>
                                    </div>
                                    <div class="content_rightblock">
                                        <p class="content_email">电子邮箱：<span><?php echo ($v["email"]); ?></span></p>
                                        <p class="content_phone">移动电话：<span><?php echo ($v["tel"]); ?></span></p>
                                        <p class="content_homepage">个人主页：<span><?php echo ($v["website"]); ?></span></p>
                                        <p class="content_qq">QQ号码：<span><?php echo ($v["qqnumber"]); ?></span></p>
                                    </div>
                                </div>
                            </div><?php endforeach; endif; ?>
							
                            <div class="body_block body_block-address">
                                <h3>地址管理</h3>
                                <div class="block_address">
                                    <ul class="address_select">
										<?php if(is_array($adress_info)): foreach($adress_info as $key=>$v): ?><li class="mod-address mod-address-added <?php if($v["default"] == 1): ?>mod-address-added-default<?php endif; ?>">
                                            <p class="address_acceptor">
                                                <span class="acceptor_name"><?php echo ($v["realname"]); ?></span>
                                                <span class="acceptor_phone"><?php echo ($v["mobile"]); ?></span>
                                            </p>
                                            <p class="address_detail"><?php echo ($v["adetail"]); ?></p>
                                            <div class="address_change">
                                                <!--<span class="change_setdefault">设为默认</span>--><a href="javascript:query_address(<?php echo ($v["id"]); ?>);"><i class="i-address-modify"></i></a> | <a href="javascript:delete_address(<?php echo ($v["id"]); ?>);"><i class="i-address-delete" onclick="return confirm('请确认是否删除该地址');"></i></a>
                                            </div>
                                            <i class="i-mod-address-default"></i>
                                        </li><?php endforeach; endif; ?>

                                        <li id="add_address_button" class="mod-address mod-address-add">
                                            <i></i><span>添加新地址</span>
                                        </li>
                                    </ul>
                                </div>
                            </div>
                       
                        </div>
                    </div>
                </div>
            </div>
        </div>
		<!--添加地址弹出层-->
		<div id="add_address_div" class="mod-popup mod-popup-address">
            <div class="popup_mask">
            </div>
            <div class="popup_body">
                <div class="body_content">
                    <p class="content_title">新增收货地址</p>
                    <form action="">
                        <div class="mod-form-block mod-form-block-input mod-form-block-input-name">
                            <label for="">收件人</label>
                            <div>
                                <div>
                                    <input id="realname" type="text" placeholder="请输入收件人">
                                </div>
                                <span class="formtips-error">您输入的收件人有误，请重新输入</span>
                            </div>
                        </div>

                        <div class="mod-form-block mod-form-block-input mod-form-block-input-phone">
                            <label for="">手机号码</label>
                            <div>
                                <div>
                                    <input id="mobile" type="text" placeholder="请输入手机号码">
                                </div>
                                <span class="formtips-error">您输入的手机号码有误，请重新输入</span>
                            </div>
                        </div>
						
						<div class="mod-form-block mod-form-block-input mod-form-block-input-name">
                            <label for="">邮编</label>
                            <div>
                                <div>
                                    <input id="zipcode" type="text" placeholder="请输入邮编">
                                </div>
                                <span class="formtips-error">您输入的收件人有误，请重新输入</span>
                            </div>
                        </div>

                        <div class="mod-form-block mod-form-block-textarea mod-form-block-textarea-address">
                            <label for="">详细地址</label>
                            <div>
                                <div>
                                    <textarea name="" id="adetail" style="height:70px;" placeholder="请输入详细地址"></textarea>
                                </div>
                                <span class="formtips-error">您输入的详细地址有误，请重新输入</span>
                            </div>
                        </div>

                        <div class="mod-form-block mod-form-block-checkbox">
                            <div>
                                <div class="form-block_checkboxes">
                                    <input id="default" class="input-checkbox" type="checkbox"><span>将此地址设为默认地址</span>
                                </div>
                                <p class="form-block_tips">注：赠品将通过默认地址邮寄</p>
                            </div>
                        </div>
                    </form>
                </div>
                <div class="body_btns">
                    <a class="mod-btn mod-btn-blue" href="javascript:submit_add_address();">保存收货地址</a>
                    <a class="mod-btn mod-btn-black mod-btn-close" href="">取消</a>
                </div>
                <i class="i-close"></i>
            </div>
        </div>
		<!--修改地址弹出层-->
		<div id="edit_address" class="mod-popup mod-popup-address">
            <div class="popup_mask">
            </div>
            <div class="popup_body">
                <div class="body_content">
                    <p class="content_title">修改收货地址</p>
                    <form action="">
                        <div class="mod-form-block mod-form-block-input mod-form-block-input-name">
                            <label for="">收件人</label>
                            <div>
                                <div>
                                    <input id="edit_adress_realname" type="text" placeholder="请输入收件人">
                                </div>
                                <span class="formtips-error">您输入的收件人有误，请重新输入</span>
                            </div>
                        </div>

                        <div class="mod-form-block mod-form-block-input mod-form-block-input-phone">
                            <label for="">手机号码</label>
                            <div>
                                <div>
                                    <input id="edit_adress_mobile" type="text" placeholder="请输入手机号码">
                                </div>
                                <span class="formtips-error">您输入的手机号码有误，请重新输入</span>
                            </div>
                        </div>
						
						<div class="mod-form-block mod-form-block-input mod-form-block-input-name">
                            <label for="">邮编</label>
                            <div>
                                <div>
                                    <input id="edit_adress_zipcode" type="text" placeholder="请输入邮编">
                                </div>
                                <span class="formtips-error">您输入的收件人有误，请重新输入</span>
                            </div>
                        </div>

                        <div class="mod-form-block mod-form-block-textarea mod-form-block-textarea-address">
                            <label for="">详细地址</label>
                            <div>
                                <div>
                                    <textarea name="" id="edit_adress_adetail" style="height:70px;" placeholder="请输入详细地址"></textarea>
                                </div>
                                <span class="formtips-error">您输入的详细地址有误，请重新输入</span>
                            </div>
                        </div>

                        <div class="mod-form-block mod-form-block-checkbox">
                            <div>
                                <div class="form-block_checkboxes">
                                    <input id="edit_adress_default" class="input-checkbox" type="checkbox"><span>将此地址设为默认地址</span>
									<input id="edit_adress_id" hidden />
                                </div>
                                <p class="form-block_tips">注：赠品将通过默认地址邮寄</p>
                            </div>
                        </div>
                    </form>
                </div>
                <div class="body_btns">
                    <a class="mod-btn mod-btn-blue" href="javascript:submit_edit_address();">保存收货地址</a>
                    <a class="mod-btn mod-btn-black mod-btn-close" href="">取消</a>
                </div>
                <i class="i-close"></i>
            </div>
        </div>
		<!--弹出层-->
		<div id="address_success" class="mod-popup mod-popup-report">
					<div class="popup_mask">
					</div>
					<div class="popup_body">
						<div class="body_content">
							<p class="content_title">操作成功!</p>
							<p class="content_text">收货地址操作成功，返回页面查看。</p>
						</div>
						<div class="body_btns">
							<a class="mod-btn mod-btn-blue mod-btn-close" onclick="window.location.reload()">返回页面</a>
						</div>
						<i class="i-close"></i>
					</div>
		</div>
		<div id="address_fail" class="mod-popup mod-popup-report">
					<div class="popup_mask">
					</div>
					<div class="popup_body">
						<div class="body_content">
							<p class="content_title">操作失败!</p>
							<p id="fail_content" class="content_text">地址操作错误，请尝试重新提交。</p>
						</div>
						<div class="body_btns">
							<a class="mod-btn mod-btn-blue mod-btn-close" onclick="window.location.reload()">返回页面</a>
						</div>
						<i class="i-close"></i>
					</div>
		</div>
		<script>
			function submit_add_address(){
							//var  verify_code_val = $("#verify_code").val();
							var  adetail_val = $("#adetail").val();
							var  mobile_val = $("#mobile").val();
							var  zipcode_val = $("#zipcode").val();
							var  realname_val = $("#realname").val();
							var  default_val = $('#default').attr('checked');
							if (default_val == 'checked'){
								default_val = "1";
							} else {
								default_val = "0";
							}
							$.ajax({
								url: "/user.php?m=user&c=info&a=add_address",
								type: "POST",
								data: {realname:realname_val,zipcode:zipcode_val,mobile:mobile_val,adetail:adetail_val,default:default_val},
								success: function (data) {
									if (data.status == "1") {
										$("#address_success").css("display","block");
									}else{
										$("#address_fail").css("display","block");
										$("#fail_content").text(data.info);
									}
								},
								error: function () {
									$("#address_fail").css("display","block");
								}
							});
			}
			
			
			function submit_edit_address(){					
							var  adetail_val = $("#edit_adress_adetail").val();
							var  mobile_val = $("#edit_adress_mobile").val();
							var  zipcode_val = $("#edit_adress_zipcode").val();
							var  realname_val = $("#edit_adress_realname").val();
							var  adress_id_val = $("#edit_adress_id").val();
							var  default_val = $('#edit_adress_default').attr('checked');
							if (default_val == 'checked'){
								default_val = "1";
							} else {
								default_val = "0";
							}
							$.ajax({
								url: "/user.php?m=user&c=info&a=edit_address",
								type: "POST",
								data: {id:adress_id_val,realname:realname_val,zipcode:zipcode_val,mobile:mobile_val,adetail:adetail_val,default:default_val},
								success: function (data) {
									if (data.status == "1") {
										$("#address_success").css("display","block");
									}else{
										$("#address_fail").css("display","block");
										$("#fail_content").text(data.info);
									}
								},
								error: function () {
									$("#address_fail").css("display","block");
								}
							});
			}
			
			function query_address(address_id){
							$.ajax({
								url: "/user.php?m=user&c=info&a=query_address",
								type: "POST",
								data: {id:address_id},
								success: function (data) {
									if (data.status == "1") {
										$("#edit_adress_realname").attr("value",data.realname);
										$("#edit_adress_mobile").attr("value",data.mobile);
										$("#edit_adress_zipcode").attr("value",data.zipcode);
										$("#edit_adress_adetail").attr("value",data.adetail);
										$("#edit_adress_id").attr("value",address_id);
										if (data.default=="1"){
											$("#edit_adress_default").attr("checked","checked");
										}
									}else{
										$("#address_fail").css("display","block");
										$("#fail_content").text(data.info);
									}
								},
								error: function () {
									$("#address_fail").css("display","block");
								}
							});
							$("#edit_address").css("display","block");
			}
			
			function delete_address(address_id){
							$.ajax({
								url: "/user.php?m=user&c=info&a=delete_address",
								type: "POST",
								data: {id:address_id},
								success: function (data) {
									if (data.status == "1") {
										$("#address_success").css("display","block");
									}else{
										$("#address_fail").css("display","block");
										$("#fail_content").text(data.info);
									}
								},
								error: function () {
									$("#address_fail").css("display","block");
								}
							});
			}
			
		</script>
<!-- footer -->
        <div class="footer">
            <div>
                <div class="footer_about">
                    <p class="about_link">
                        <a href="<?php echo ($site_about); ?>" target="_blank">关于腾讯</a>
                        |
                        <a href="<?php echo ($site_career); ?>">加入我们</a>
                        |
                        <a href="/user.php?m=user&c=post&a=add">报告漏洞</a>
                    </p>
                    <p class="about_copyright">
                        <span>Copyright &copy; <?php echo date('Y'); ?> <?php echo ($site_copyright); ?>. All Rights Reserved</span>
						<span>Powered by <a href="https://security.tencent.com/index.php/xsrc">Tencent xSRC</a></span>
                    </p>
                </div>

                <div class="footer_contact">
                    <a class="contact_icon-email" href="mailto:<?php echo ($site_email); ?>"><i></i><span>专用邮箱</span>|</a>
                    <a class="contact_icon-weixin mod-qrcode" href="">
                        <i></i><span>微信公众号</span>
                        <div class="qrcode">
                            <div class="qrcode_pic">
                                <img src="<?php echo ($site_wechat); ?>" alt="">
                            </div>
                            <span class="qrcode_text">扫一扫关注公众号</span>
                        </div>
                    </a>
                </div>
            </div>
        </div>

        <script src="/Public/Index/js/jquery-1.7.2.min.js"></script>
        <script src="/Public/Index/js/test.js"></script>
		<script src="https://security.tencent.com/static/plugins/jquery.ajaxfileupload.js"></script>
    </body>
</html>